home *** CD-ROM | disk | FTP | other *** search
- // fv2.h - a dynamic vector of float (with a possibly
- // non-zero low-bound) using a subscripting object
- // implemented by aggregation with a float_array member
-
- #include "fa1.h"
-
- class float_vector
- {
- public:
- float_vector(int lo = 0, int hi = 0);
- float operator[](int i) const;
- fa_index operator[](int i);
- size_t length() const;
- int low() const;
- int high() const;
- operator float_array &();
- operator const float_array &() const;
- private:
- float_array fa;
- int _low;
- };
-
- inline float_vector::float_vector(int lo, int hi)
- : _low(lo), fa(hi - lo + 1)
- { }
-
- inline size_t float_vector::length() const
- {
- return fa.length();
- }
-
- inline int float_vector::low() const
- {
- return _low;
- }
-
- inline int float_vector::high() const
- {
- return _low + fa.length() - 1;
- }
-
- inline float_vector::operator float_array &()
- {
- return fa;
- }
-
- inline
- float_vector::operator const float_array &() const
- {
- return fa;
- }
-
-
-
-
-